<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Promise.all的静态</title>
</head>
<body>
    <p class="my-p"></p>
    <script>
        const bjPromise=axios({url:'http://hmajax.itheima.net/api/city',params:{city:'110100'}})
        const sjPromise=axios({url:'http://hmajax.itheima.net/api/city',params:{city:'310100'}})
        const gjPromise=axios({url:'http://hmajax.itheima.net/api/city',params:{city:'400100'}})
        const szjPromise=axios({url:'http://hmajax.itheima.net/api/city',params:{city:'440300'}})
        const p=Promise.all([ bjPromise,sjPromise,gjPromise,szjPromise])
        p.then(result=>{
            console.log(result)
            const htmlStr=result.map(item=>{
                return '<li>${item.data.data.area}---&{item.data.data.weather}</li>'
            }).join('')
            document.querySelector('my-p').innerHTML=htmlStr
        }).catch(error=>{
            console.dir(error)
        })
   </script>
</body>
</html>